package com.hqyj.controller;


import com.hqyj.aop.PowerAnnotion;
import com.hqyj.excepiton.QuestionException;
import com.hqyj.interceptor.JwtToken;
import com.hqyj.pojo.Paper;
import com.hqyj.pojo.Question;
import com.hqyj.service.IPaperService;
import javafx.print.PaperSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author rock
 * @since 2023-10-09
 */
@RestController
@RequestMapping("/paper")
public class PaperController {
    @Autowired
    IPaperService paperservice;

    /**
     * 试卷生成
     * @param paper
     * @return
     */
    @PostMapping("/paper")
    @JwtToken
    @PowerAnnotion("leader")
    public HashMap<String,Object> add(@RequestBody Paper paper)  {
        return paperservice.randomPaper(paper);
    }

}

